package com.smart.store.controller.v1;

import com.smart.store.model.request.WishDto;
import com.smart.store.model.response.WishResponse;
import com.smart.store.service.WishService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/v1/wish")
@Api(value = "Wish_Op")
public class WishController {

    @Autowired
    WishService wishService;

    @PostMapping("/{wishId}")
    public void completeWish(@PathVariable String wishId) {
        wishService.completeWish(wishId);
    }

    @DeleteMapping("/{wishId}")
    public void deleteWish(@PathVariable String wishId) {
        wishService.deleteWish(wishId);
    }

    @PostMapping("/abort/{wishId}")
    public void abortWish(@PathVariable String wishId) {
        wishService.abortWish(wishId);
    }

    @GetMapping("/")
    public List<WishResponse> getWishResponse() {
        return wishService.getWish();
    }

    @GetMapping("/complete")
    public List<WishResponse> getCompleteWish() {
        return wishService.getCompleteWish();
    }

    @PostMapping("/")
    public void makeWish(@RequestBody WishDto wishDto) {
        wishService.makeWish(wishDto);
    }

    @PutMapping("/")
    public void updateWish(@RequestBody WishDto wishDto) {
        wishService.updateWish(wishDto);
    }
}
